package cn.hx.malluser.utils;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
 * 加密工具
 */
public class MD5Util {
    public static String encrypt(String original) {
        try {
            MessageDigest md5 = MessageDigest.getInstance("MD5");
            md5.update(original.getBytes());
            return new BigInteger(1, md5.digest()).toString(16);
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
            return null;
        }
    }
}
